home *** CD-ROM | disk | FTP | other *** search
- Path: chronicle.mti.sgi.com!austern
- From: esap@cs.tut.fi (Pulkkinen Esa)
- Newsgroups: comp.std.c++
- Subject: Re: Namespace extension
- Date: 20 Feb 1996 10:40:30 PST
- Organization: Tampere University of Technology
- Approved: austern@isolde.mti.sgi.com
- Message-ID: <4g5e4v$cvi@peippo.cs.tut.fi>
- References: <4g2aj2$bko@ugress.uib.no>
- NNTP-Posting-Host: isolde.mti.sgi.com
- Keywords: C++, namespace, template
- X-Original-Date: 17 Feb 1996 20:34:39 GMT
- Nntp-Posting-User: esap
- X-Auth: PGPMoose V1.1 PGP comp.std.c++
- iQBVAwUBMSoVrUy4NqrwXLNJAQEkdAH/cH1iMSQSZ4p8+Iunyb2uQRoyHTmWt2iY
- nLtc8+13Xdt5ng1qnawMs45qFRmiiHl66/eByNylq6JZX5q7srW84Q==
- =qHYN
- Originator: austern@isolde.mti.sgi.com
-
- In article <4g2aj2$bko@ugress.uib.no>,
- Igor Boukanov <boukanov@kvark.fi.uib.no> wrote:
- >So I suggest to let template namespaces. In this case it will be possible
- >to write something like this:
- [Examples of namespace templates removed]
-
- This raises immediately the following questions:
-
- template <class T> namespace { // an unnamed namespace template - allowed?
- int i; // how many copies of this will be in the program?
- // what's the syntax for accessing the variable?
- // i<T> ? <T>::i ?
- typedef vector<T>::iterator vector_iterator; // is this the same
- // as a typedef template?
- }
- template <class T> namespace X { int f(); }
-
- template <class T> using X<T>::f(); // Allowed?
- template <class T> using namespace X<T>; // Allowed?
-
- [points to justify namespace templates removed]
- > 3. It makes C++ easy to study, because somebody will have to know only
- >the general idea about templates and how to apply them to any C++ elements
- >(function, class, namespase,...).
-
- This would only be true if also typedef templates and union templates
- were introduced too.
- --
- Esa Pulkkinen | C++ programmers do it virtually
- E-Mail: esap@cs.tut.fi | everywhere with a class, resulting
- WWW : http://www.cs.tut.fi/~esap/ | in multiple inheritance.
- ---
- [ To submit articles: Try just posting with your newsreader. If that fails,
- use mailto:std-c++@ncar.ucar.edu
- FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html
- Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html
- Comments? mailto:std.c++-request@ncar.ucar.edu
- ]
-